package com.wangzh.network.tcp.test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(10000);

        //等待客户端连接
        Socket socket = ss.accept();


        BufferedReader bf = new BufferedReader(new InputStreamReader(socket.getInputStream()));

        String temp;
        while ((temp=bf.readLine()) != null){
            System.out.println(temp);
        }

        socket.close();
        ss.close();
    }
}
